<include file="Order:leftmenu" />
<div class="content-right fl">
    <h1 class="content-right-title">发票申请</h1>
    <div class="tablesWrap">
        <table class="wxtables">
            <colgroup>
                <col width="3%">
              	<col width="6%">               
               	<col width="6%">
                <col width="6%">
            </colgroup>
            <thead>
            <tr>
                <td>编号</td>
                <td>发票信息</td>
                <td>地址信息</td>
                <td>操作</td>
            </tr>
            </thead>
            <tbody>
<?php foreach($datalist as $k=>$v){ ?>
                <tr>
                    <td><?php echo $v['id'];?></td>
                    <td>
                        金额<?php echo $v['money'];?><br>
                        抬头<?php echo $v['head'];?><br>
                        税号<?php echo $v['tax_id'];?><br>
                        类型<?php echo $v['type']==1?'普通票':'增值票';?><br>
                    </td>
                    <td>
                        <?php echo $v['realname'];?>-<?php echo $v['mobile'];?><br>
                        <?php echo $v['province'];?>-
                        <?php echo $v['city'];?>-
                        <?php echo $v['county'];?>-
                        <?php echo $v['address'];?><br>
                    </td>
                  
                    <td>
                        快递公司<input value="<?=$v['express']?>" class='input mini express'/><br>
                        快递单号<input value="<?=$v['express_no']?>" class='input mini express_no'/><br>
                        <a id="<?=$v['id']?>" class="btn btn-primary vtal-2 setExpress">保存</a>
                    </td>
                </tr>
<?php } ?>                         
            </tbody>
        </table>
	<div class="tables-btmctrl clearfix">
           <div class="mgt10">
               <div class="paginate">
                  {$page}
               </div>
           </div>
	</div>
    </div>
</div>
<script>
    $('.setExpress').on('click',function(){
        var id = $(this).attr('id');
        var express = $(this).parent('td').children('.express').val();
        var express_no = $(this).parent('td').children('.express_no').val();
        $.ajax({
            url: '/admin/order/setexpress',
            type: 'post',
            data: {
                id: id,
                express: express,
                express_no: express_no
            },
            success: function(res) {
                layer.closeAll();
                if(res.ret==0) {
                    layer.msg(res.msg, {icon: 1});
                }else{
                    layer.msg(res.msg, {icon: 2});
                }
            },
            beforeSend:function(){
                layer.load();
            },
        })
    })
</script>